import tkinter as tk
from tkinter import filedialog

def open_folder_dialog():
    root = tk.Tk()
    root.withdraw()
    folder_path = filedialog.askdirectory()
    return folder_path

# 调用函数来打开文件夹选择窗口
selected_folder = open_folder_dialog()
print("选择的文件夹路径为：", selected_folder)